package com.runyu.cordova.plugin;

import android.content.Context;
import android.content.SharedPreferences;

public class AppPreferences {
    private static final String PREF_NAME = "MyAppPreferences";
    public static final String KEY_INIT = "init";
    public static final String KEY_ENCRYPTED_DEVICE_ID = "encrypted_uuid";

    public static void save2Preferences(Context context, String key, String value){
        SharedPreferences preferences = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
        preferences.edit().putString(key, value).apply();
    }

    public static String getFromPreferences(Context context, String key){
        SharedPreferences preferences = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
        return preferences.getString(key, null);
    }


}
